<%@page import="bean.MemberVO"%>
<%@page import="bean.MemberDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>로그인 페이지</title>
<link rel="stylesheet" href="../css/style.css"/>
<script type="text/javascript" src="./js/loginProcess.js"></script>
</head>
<body>
<% 	
	String sessionMid = (String)session.getAttribute("sessionMid");
%>
	<aside class="sidebar">
		<article>
			<h2>login</h2>
    <form name="login" method= "post" ><p/>
    <%if(sessionMid == null){%>
      <label class="lbl">ID </label>
        <input type = "text" name ="m_id" size = "13"><br>
      <label class="lbl">PW </label>
        <input type = "password" name ="m_pw" size = "13"><br>
        <p/>
      <input type="button" id="btn_login" value="로그인">
      <input type="button" id= "btn_signup" value="회원가입">
      
      <%}
    else{
    	MemberDTO mdto = new MemberDTO();
    	MemberVO mvo = new MemberVO();
    	mvo = mdto.selectOne(sessionMid);
    %>
    <%if(mvo.getM_photo() != null) {%>
    <img src="./member/memberPhoto/<%=mvo.getM_photo() %>"  alt="프로필사진"  width="100%" height="50%"/>
    <%}else{%>
    이미지가 없습니다.
    <%} %><br>
    <%=mvo.getM_id() %>님 환영합니다.</br>
    내 정보</br>
    성별 : <%if(mvo.getM_gender() == "m"){
    	out.print("남자");
    }else{
    	out.print("여자");
    }
    	%></br>
    지역 : <%=mvo.getM_local() %></br>
    직업 : <%=mvo.getM_job() %></br>
    나이 : <%=mvo.getM_age() %>세</br>
    카카오 ID : <%=mvo.getM_ka() %></br>
      <input type="button" id= "btn_logout" value="로그아웃" >
      <%} %>
    </form>
    		</article>
	</aside>
    <script type="text/javascript">loginProcess();</script>
</body>
</html>